package com.hzncc.flowable_diboot.mapper;

import com.hzncc.flowable_diboot.entity.Customer;
import com.diboot.core.mapper.BaseCrudMapper;
import com.hzncc.flowable_diboot.vo.CustomerListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* 客户 相关Mapper层接口定义
* @author MyName
* @version 1.0
* @date 2024-05-15
* Copyright © MyCorp
*/
@Mapper
public interface CustomerMapper extends BaseCrudMapper<Customer> {

    List<CustomerListVO> selectStarCustom(String uid,String name);

    List<Customer> selectExpireCustomer(int num);

    void updateExpire();

    @Select("select mc.id from mdl_customer mc left join mdl_star_custom msc on mc.id = msc.custom_id where msc.user_id = #{uid} and mc.is_deleted = 0 and msc.is_deleted = 0")
    List<String> selectStarCustomerId(String uid);
}